package com.chb.sso.factory;

import com.chb.sso.feign.UserFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/7 17:44
 * @description:
 * @modified By:
 * @version:
 */
@Component
@Slf4j
public class MyUserFallbackFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        return phone -> {
            log.error("系统服务故障.............");
            log.error(throwable.getMessage());
            return null;
        };
    }
}